library(e1071)
library(caret)

setwd("D:/ClassificationR")

#membaca data training & data testing
data.training = read.csv("iris2class.train.1.csv")
data.test = read.csv("iris2class.test.1.csv")

#proses 2
#membuat model 
model = naiveBayes(Species~., data.training)

#proses 3
#melakukan prediksi
predict_result = predict(model, data.test[,-5])

#menghitung kinerja
performance.value = confusionMatrix(predict_result, data.test[,5])
print(performance.value)
